
public class ThreadPool implements Runnable{
    private final int id;
    //-------------------------------------------------
    public ThreadPool(int id) {
        this.id = id;
    }
    //-------------------------------------------------
    @Override
    public void run() {
        long threadsID = Thread.currentThread().getId();
        System.out.println("Start " + id + "in thread " + threadsID);
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e){
            e.printStackTrace();
        }
        System.out.println("Finish " + id + "in thread" + threadsID);
    }
}
